<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8" />
    <title>Posts &laquo; Admin</title>
    <%- include('./BG_layouts/header.ejs')%>
  </head>

  <body>
    <script>
      NProgress.start();
    </script>

    <div class="main">
      <%- include('./BG_layouts/navbar.ejs') %>
      <div class="container-fluid">
        <div class="page-title">
          <h1>所有文章</h1>
          <a href="post-add.html" class="btn btn-primary btn-xs">写文章</a>
        </div>
        <!-- 有错误信息时展示 -->
        <!-- <div class="alert alert-danger">
        <strong>错误！</strong>发生XXX错误
      </div> -->
        <div class="page-action">
          <!-- show when multiple checked -->
          <a
            class="btn btn-danger btn-sm"
            href="javascript:;"
            style="display: none"
            >批量删除</a
          >
          <form class="form-inline">
            <input type="text" class="searchName" placeholder="请输入标题" />
            <button class="btn btn-default btn-sm search" type="button">
              搜索
            </button>
          </form>
          <ul class="pagination pagination-sm pull-right ">
            <li><a href="#">上一页</a></li>
            <li><a href="#">1</a></li>
            <li><a href="#">2</a></li>
            <li><a href="#">3</a></li>
            <li><a href="#">下一页</a></li>
          </ul>
        </div>
        <table class="table table-striped table-bordered table-hover">
          <thead>
            <tr>
              <th class="text-center" width="40"><input type="checkbox" /></th>
              <th>标题</th>
              <th>作者</th>
              <th>分类</th>
              <th class="text-center">发表时间</th>
              <th class="text-center">点击数</th>
              <th class="text-center" width="100">操作</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td class="text-center"><input type="checkbox" /></td>
              <td>随便一个名称</td>
              <td>小小</td>
              <td>潮科技</td>
              <td class="text-center">2016/10/07</td>
              <td class="text-center">已发布</td>
              <td class="text-center">
                <a href="javascript:;" class="btn btn-default btn-xs">编辑</a>
                <a href="javascript:;" class="btn btn-danger btn-xs">删除</a>
              </td>
            </tr>
            <tr>
              <td class="text-center"><input type="checkbox" /></td>
              <td>随便一个名称</td>
              <td>小小</td>
              <td>潮科技</td>
              <td class="text-center">2016/10/07</td>
              <td class="text-center">已发布</td>
              <td class="text-center">
                <a href="javascript:;" class="btn btn-default btn-xs">编辑</a>
                <a href="javascript:;" class="btn btn-danger btn-xs">删除</a>
              </td>
            </tr>
            <tr>
              <td class="text-center"><input type="checkbox" /></td>
              <td>随便一个名称</td>
              <td>小小</td>
              <td>潮科技</td>
              <td class="text-center">2016/10/07</td>
              <td class="text-center">已发布</td>
              <td class="text-center">
                <a href="javascript:;" class="btn btn-default btn-xs">编辑</a>
                <a href="javascript:;" class="btn btn-danger btn-xs">删除</a>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>

    <%- include('./BG_layouts/aside.ejs') %> <%-
    include('./BG_layouts/footer.ejs') %>
    <script type="text/template" id="posts_article_template">
      {{each list}}
        <tr>
            <td class="text-center"><input type="checkbox"></td>
            <td>{{$value.title}}</td>
            <td>{{$value.author}}</td>
            <td>{{$value.option}}</td>
            <td class="text-center">{{$value.created_at}}</td>
            <td class="text-center">{{$value.clickrate}}</td>
            <td class="text-center">
              <a href="javascript:;" class="btn btn-danger btn-xs btn-remove" data-id="{{$value.id}}">删除</a>
            </td>
          </tr>
        {{/each}}
    </script>
    <script src="/background/lib/twbs-pagination/jquery.twbsPagination.min.js"></script>
    <script src="/background/js/posts.js"></script>
  </body>
</html>
